package com.sophic_tech.hkb.controller;

import com.sophic_tech.hkb.entity.AuthModel;
import com.sophic_tech.hkb.entity.Result;
import com.sophic_tech.hkb.service.auth.Impl.AuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/auth")
public class AuthController {
    @Autowired
    AuthService authService;
    @PostMapping("/login")
    public Result Login(@RequestBody AuthModel user) {
        return authService.loginService(user);
    }

    @PostMapping("/register")
    public Result register(@RequestBody AuthModel user) {
        return authService.registerService(user);
    }
}
